Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: docker compose up failing on localhost #182

Merged
merged 2 commits into from
Mar 17, 2024

Conversation

aadeshkulkarni
Copy link

Fixes #181

Issue - Docker compose fails locally with 2 errors

Issue #1:

Error response from daemon: Mounts denied The path /postgres-data is not shared from the host and is not known to Docker.

Screenshot 2024-03-10 at 4 45 57 PM

Solution:

Changing
volumes: - /postgres-data:/var/lib/postgresql/data
to
volumes: - ./postgres-data:/var/lib/postgresql/data

Issue #2:

cms-docker: Error P1001: Can't reach database server at 'db':'5432'
Please make sure your database server is running at db:5432
Screenshot 2024-03-10 at 5 14 13 PM

Solution:

  • Add health check condition for db in depends_on to ensure docker-cms runs only after docker-db is up and ready.
  • Add health check to postgres docker container

Additional resources:

@aadeshkulkarni aadeshkulkarni marked this pull request as draft March 10, 2024 12:38
@aadeshkulkarni aadeshkulkarni changed the title fix: docker compose depends on fix fix: docker compose up failing on localhost Mar 10, 2024
@aadeshkulkarni aadeshkulkarni marked this pull request as ready for review March 11, 2024 09:32
@hkirat hkirat merged commit c052bf9 into code100x:main Mar 17, 2024
1 check passed
@hkirat
Copy link
Contributor

hkirat commented Mar 17, 2024

/bounty $30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docker-compose up Error
2 participants